package cn.edu.fzu.homemaking.company.handler;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;

import com.google.common.collect.ImmutableList;
import org.springframework.context.annotation.Configuration;

import java.util.List;

/**
 * @author fangxin
 * @date 2022年11月9日
 */
@Configuration
public class HandlerConfig {

    private final List<OrderHandler> orderHandlers;

    @Autowired
    public HandlerConfig(OrderHandler orderUserPoolBuilderHandler, OrderHandler orderUserFilterHandler,
                         OrderHandler orderUserAllotHandler) {

        //服务员分配处理器
        this.orderHandlers = ImmutableList.of(
                //服务员池子构建
                orderUserPoolBuilderHandler,
                //服务员过滤
                orderUserFilterHandler,
                //服务员分配
                orderUserAllotHandler);

    }


    @Bean("orderHandlers")
    public List<OrderHandler> deliveryHandlers() {
        return orderHandlers;
    }

}
